import React, { useEffect, useRef } from 'react';

const Component = React.forwardRef((props, ref) => {
  return (
    <h2>component</h2>
  );
});

export default function AutoFocus() {
  const ref = useRef<any>();
  useEffect(() => {
    console.log(ref);
    console.log(ref.current);
  }, []);
  return (
    <div>
      <Component ref={ref} />
    </div>
  );
}
